package redmi

import (
	"fmt"
	af "learning/gooop/creational_patterns/abstract_factory"
)

type tRedmiAirConditioner struct {
	af.DeviceInfo

	fTemperature float64
}


func newMijiaAirConditioner(info *af.DeviceInfo) *tRedmiAirConditioner {
	return &tRedmiAirConditioner{
		*info, 0,
	}
}

func (me *tRedmiAirConditioner) Open() error {
	fmt.Printf("tRedmiAirConditioner.Open, %v\n", &me.DeviceInfo)
	return nil
}

func (me *tRedmiAirConditioner) Close() error {
	fmt.Printf("tRedmiAirConditioner.Close, %v\n", &me.DeviceInfo)
	return nil
}

func (me *tRedmiAirConditioner) GetTemperature() (error, float64) {
	fmt.Printf("tRedmiAirConditioner.GetTemperature, %v\n", me.fTemperature)
	return nil, me.fTemperature
}

func (me *tRedmiAirConditioner) SetTemperature(t float64) error {
	me.fTemperature = t
	fmt.Printf("tRedmiAirConditioner.SetTemperature, %v\n", me.fTemperature)
	return nil
}